<template>
  <div>
    <h1>父组件</h1>
    <h1>子组件名字：{{ mysonname }}</h1>
    <h1>子组件年龄：{{ mysonage }}</h1>
    <h2 v-for="item in mysonaihao" :key="item">{{ item }}</h2>
    <input type="text" v-model="ms" />
    <hr />
    <zi-com @sendData="getData" :mm="true" :msg="ms" :list="list"></zi-com>
    <hr />
    <er-com></er-com>
  </div>
</template>
<script>
import ziCom from './Zi.vue'
import erCom from './er.vue'
export default {
  data () {
    return {
      ms: '1',
      list: ['7月12', '10月1', '8月15'],
      mysonname: '',
      mysonage: '',
      mysonaihao: []
    }
  },
  methods: {
    // 父组件事件函数的形参 就是子传父的数据
    getData (a, b, c) {
      this.mysonname = a
      this.mysonage = b
      this.mysonaihao = c
    }
  },
  components: { ziCom: ziCom, erCom }
}
</script>
<style lang="less"></style>
